using Universe.OneC;

namespace Universe.OneC
{
    public class InfoBase
    {
        private Cluster _Cluster;
        private string _DBMS;
        private string _dbName;
        private string _dbPassword;
        private string _dbServerName;
        private string _dbUser;
        private string _FileBase;
        private string _Name;
        private string _Password;
        private ServerInfo _Server;
        private string _UserName;

        private InfoBase()
        {
            this._FileBase = "";
            this._Name = "";
            this._DBMS = "";
            this._dbServerName = "";
            this._dbName = "";
            this._dbUser = "";
            this._dbPassword = "";
            this._UserName = "";
            this._Password = "";
        }

        public InfoBase(Cluster cluster)
        {
            this._FileBase = "";
            this._Name = "";
            this._DBMS = "";
            this._dbServerName = "";
            this._dbName = "";
            this._dbUser = "";
            this._dbPassword = "";
            this._UserName = "";
            this._Password = "";
            this._Cluster = cluster;
            this._Server = cluster.Server;
        }

        public InfoBase(ServerInfo server)
        {
            this._FileBase = "";
            this._Name = "";
            this._DBMS = "";
            this._dbServerName = "";
            this._dbName = "";
            this._dbUser = "";
            this._dbPassword = "";
            this._UserName = "";
            this._Password = "";
            this._Server = server;
        }

        public InfoBase(Cluster cluster, string name) : this(cluster)
        {
            this._Name = name;
        }

        public InfoBase(ServerInfo server, string name) : this(server)
        {
            this._Name = name;
        }

        public override string ToString()
        {
            return this._Name;
        }

        public string Address
        {
            get
            {
                string str = "";
                if ((this._FileBase != null) && (this._FileBase != string.Empty))
                {
                    str = str + "File=\"" + this._FileBase + "\";";
                }
                else
                {
                    string str2 = str;
                    str = str2 + "Srvr=" + this._Server.Name + ";Ref=" + this._Name + ";";
                }
                if ((this._UserName != null) && (this._UserName != string.Empty))
                {
                    str = str + "Usr=\"" + this._UserName + "\";";
                }
                if ((this._Password != null) && (this._Password != string.Empty))
                {
                    str = str + "Pwd=\"" + this._Password + "\";";
                }
                return str;
            }
        }

        public Cluster Cluster
        {
            get
            {
                return this._Cluster;
            }
        }

        public string DBMS
        {
            get
            {
                return this._DBMS;
            }
            set
            {
                this._DBMS = value;
            }
        }

        public string dbName
        {
            get
            {
                return this._dbName;
            }
            set
            {
                this._dbName = value;
            }
        }

        public string dbPassword
        {
            get
            {
                return this._dbPassword;
            }
            set
            {
                this._dbPassword = value;
            }
        }

        public string dbServerName
        {
            get
            {
                return this._dbServerName;
            }
            set
            {
                this._dbServerName = value;
            }
        }

        public string dbUser
        {
            get
            {
                return this._dbUser;
            }
            set
            {
                this._dbUser = value;
            }
        }

        public string FileBase
        {
            get
            {
                return this._FileBase;
            }
            set
            {
                this._FileBase = value;
            }
        }

        public string Name
        {
            get
            {
                return this._Name;
            }
            set
            {
                this._Name = value;
            }
        }

        public string Password
        {
            get
            {
                return this._Password;
            }
            set
            {
                this._Password = value;
            }
        }

        public ServerInfo Server
        {
            get
            {
                return this._Server;
            }
        }

        public string UserName
        {
            get
            {
                return this._UserName;
            }
            set
            {
                this._UserName = value;
            }
        }
    }
}